IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[vrptLabels]'))
drop view [vrptLabels]
go
create view [dbo].[vrptLabels] as
SELECT s.LastName + ' ' + s.FirstName+ char(13)+ 
			dbo.getStudentAddress(s.StudentId) as label,
			s.CountryId, 
			s.DistrictId,
			s.StudentId,
			ltrim(rtrim( ISNULL( s.Company,''))) as Company,
			isnull(convert(varchar,s.MemberNumber),'') as MemberNumber,
			s.IsMemberActive
FROM dbo.Student AS s LEFT OUTER JOIN
     dbo.Country AS c ON s.CountryId = c.CountryId LEFT OUTER JOIN
     dbo.District AS d ON s.DistrictId = d.DistrictId
GO


